<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>在线考试系统</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/admin/launchExam.css">
</head>

<body>
    <%- include ("../publicEjs/public.ejs")%>

    <div class="container-fluid" style="margin-top: 80px;">
        <div class="row">
            <%- include ("../publicEjs/adminLeft.ejs")%>
            <div class="col-9">
                <form id="lunchExam" method="post" enctype="multipart/form-data">
                    <div class="form-row">
                        <div class="col-md-4 mb-3">
                            <label for="validationDefault01">考试名称</label>
                            <input name="remark" type="text" class="form-control" id="remark" required>
                        </div>
                        <!-- <div class="col-md-4 mb-3">
                            <label for="validationDefault06">考试科目</label>
                            <select class="custom-select" id="validationDefault06" required>
                                <option selected disabled value="">选择考试科目</option>
                                <option value="语文">语文</option>
                                <option value="数学">数学</option>
                                <option value="英语">英语</option>
                            </select>
                        </div> -->
                        <!-- <div class="col-md-3 mb-3">
                            <label for="validationDefault05">备注</label>
                            <input name="remark" type="text" class="form-control" id="validationDefault05">
                        </div> -->
                    </div>
                    <div class="form-row">
                        <div class="col-md-3 mb-3">
                            <label for="validationDefault03">考试开始时间</label>
                            <input name="startTime" type="datetime-local" class="form-control" id="validationDefault03"
                                required>

                        </div>
                        <div class="col-md-3 mb-3">
                            <label for="validationDefault05">考试结束时间</label>
                            <input name="endTime" type="datetime-local" class="form-control" id="validationDefault05"
                                required>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="col-md-3 mb-3">
                            <label for="validationDefault04">使用试卷</label>
                            <select name="testWordId" class="custom-select" id="validationDefault04" required>
                                <option selected disabled value="">选择试卷</option>
                                
                                <%for(var i=0;i<list.length;i++) { %>

                                <option value="<%=list[i].testNumber%>"><%=list[i].testName%></option>

                                <% } %>

                            </select>
                        </div>
                    </div>

                    <button onclick="launch()" class="btn btn-primary" style="display: block;margin: 5px 0 10px;"
                        type="button">创建考试</button>
                </form>
                <div>

                    <label style="display: block;">批量导入考生信息</label>
                    <div class="form-group">
                        <div class="btn-group" role="group" aria-label="Basic example">
                            <button onclick="download()" type="button" class="btn btn-secondary">下载模板</button>
                            <button onclick="upload()" type="button" class="btn btn-secondary">上传模板</button>
                        </div>
                        <form id="uploadForm" action="http://localhost:9023/student_work/readExcel" method="post"
                            enctype="multipart/form-data" target="nm_iframe">
                            <input type="file" name="studentExcel" id="ExcelTemplate">
                            <input type="text" name="testNumber" id="testNumber" style="display: none;">
                        </form>
                    </div>
                    <p>
                        <a class="" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false"
                            aria-controls="collapseExample">
                            导入信息注意事项
                        </a>
                    </p>
                    <div class="collapse" id="collapseExample">
                        <div class="card card-body">
                            请勿修改EXCEL表头信息，请勿修改EXCEL表格格式</br>
                            请先创建考试再导入考生信息
                        </div>
                    </div>
                    <!-- <button class="btn btn-primary" style="display: block;margin-top: 15px;" type="submit">提交</button> -->
                </div>
            </div>
        </div>
    </div>

    <%- include ("../publicEjs/foot.ejs")%>

    <iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js"
        integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"
        integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
        crossorigin="anonymous"></script>
    <script src="/js/jquery.js"></script>
    <script src="/js/backstage/launchExam.js"></script>
    <script src="/js/admin/publicAdmin.js"></script>
</body>

</html>